#ifndef STDFIN_NUMERICAL_INTEGRATION_MIDPOINT_HPP
#define STDFIN_NUMERICAL_INTEGRATION_MIDPOINT_HPP

namespace stdfin {

template <class F>
double integrate_midpoint(const F& f, double a, double b, unsigned long n)
{ 
    double sum = 0;
    double dx = (b - a) / n;
    for (double x = a + dx/2; x < b; x += ds)
        sum += f(x);
    return dx * sum;
}

} // namespace 
#endif